Skip to content

chore: Update single-library.git-migrate-history.sh to support git submodules#16103

Closed
parthea wants to merge 4 commits intomainfrom
parthea-patch-10
Closed

chore: Update single-library.git-migrate-history.sh to support git submodules#16103
parthea wants to merge 4 commits intomainfrom
parthea-patch-10

Conversation

@parthea
Copy link
Contributor

@parthea parthea commented Mar 13, 2026

This PR includes a minor tweak to the migration scripts, specifically scripts/split_repo_migration/single-library.git-migrate-history.sh, to support migrating git submodules

@parthea parthea marked this pull request as ready for review March 13, 2026 16:37
@parthea parthea requested review from a team as code owners March 13, 2026 16:37
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the single-library.git-migrate-history.sh script to provide more robust support for Git submodules during repository history migration. The changes ensure that submodules are correctly cloned, initialized, and updated throughout the migration process, preventing potential issues with submodule content or history loss.

Highlights

  • Git Clone Submodule Recursion: Modified git clone commands to include an additional --recurse-submodules flag, ensuring deeper submodule initialization during initial cloning and validation.
  • Git Filter-Branch Submodule Update: Appended an extra git submodule update --init --recursive command within the git filter-branch --tree-filter to enhance submodule handling during the history rewriting process.
Changelog
  • scripts/split_repo_migration/single-library.git-migrate-history.sh
    • Added an extra --recurse-submodules flag to all git clone commands within the script.
    • Inserted an additional git submodule update --init --recursive command into the git filter-branch --tree-filter argument.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request aims to improve support for git submodules in the migration script by adding more --recurse-submodules flags to git clone and repeating submodule update commands in the git filter-branch step. While the intent is good, the added flags and commands are redundant. A single --recurse-submodules flag is sufficient for git clone, and the git submodule update --init --recursive command already handles nested submodules, so it doesn't need to be repeated. I've left comments with suggestions to remove the redundant code, which will make the script cleaner and more efficient.

parthea and others added 3 commits March 13, 2026 12:43
…y.sh

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…y.sh

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…y.sh

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@parthea parthea closed this Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant